package com.umeox.ota.data.repository;

import android.app.Application;

import com.umeox.ota.data.db.DatabaseModule;
import com.umeox.ota.data.repository.cache.Cache;
import com.umeox.ota.data.repository.cache.CacheType;


/**
 * Dagger RepositoryModule
 */

public class RepositoryModule {
    private Application mApplication;

    public RepositoryModule(Application application) {
        this.mApplication = application;
    }

    IRepositoryManager provideRepositoryManager(Cache.Factory cacheFactory,
                                                DatabaseModule.RoomConfiguration roomConfiguration) {
        return new RepositoryManager(mApplication, cacheFactory, roomConfiguration);
    }

    Cache<String, Object> provideExtras(Cache.Factory cacheFactory) {
        return cacheFactory.build(CacheType.EXTRAS_CACHE_TYPE);
    }
}
